package com.zzh.app.plugin.xhttputils;

import android.os.Build;

import com.zzh.lib.core.utils.LogUtils;

import java.util.HashMap;

/**
 * Created by ZZH on 2020-01-09.
 *
 * @Date: 2020-01-09
 * @Email: zzh_hz@126.com
 * @QQ: 1299234582
 * @Author: zzh
 * @Description: body体提交参数
 */
public class ParamMap extends HashMap<String, Object> {
    private boolean showLoadingDialog = false;

    private String url;
    private boolean isAuth = false;
    private String clientType = "";

    public ParamMap(String url) {
        this(url, false);
    }

    public ParamMap(String url, boolean flag) {
        this.url = url;
        initParams();
    }

    /**
     * 系统级参数
     */
    private void initParams() {
        try {
            put("zyOs", "Android");
            //手机系统版本号
            put("zyOsVersion", Build.VERSION.RELEASE);
            //手机型号
            put("zyModel", Build.MODEL);
            //手机厂商
            put("zyBrand", Build.BRAND);
            put("zyManufacturer", Build.MANUFACTURER);
        } catch (Exception e) {
            LogUtils.e(e.getMessage());
        }
    }

    public boolean isShowLoadingDialog() {
        return showLoadingDialog;
    }

    public void setShowLoadingDialog(boolean showLoadingDialog) {
        this.showLoadingDialog = showLoadingDialog;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public boolean isAuth() {
        return isAuth;
    }

    public ParamMap setAuth(boolean auth) {
        isAuth = auth;
        return this;
    }

    public String getClientType() {
        return clientType;
    }

    public void setClientType(String clientType) {
        this.clientType = clientType;
    }
}
